270 POKE 34,20: HOME : HGR : HCOLOR= 6: HPLOT 0,0 TO 0,159 TO 268,159 TO 268,0 TO 2,0 TO 2,158 TO 266,158 TO 266,1 TO 2,1: FOR C = 1 TO 35:V(C) = D(C):D(C) = 0
280 S(C) = 14
290 IF V(C) >13 THEN S(C) = S(C) +1:V(C) = V(C) -13: GOTO 290
405 HTAB 1: VTAB 21: PRINT "[<- ->] MOVE POINTER [ESC] = QUIT": PRINT "[SPACE] PLAY CARD TO OUTPUT FILE [1-9-0] PLAY CARD FROM DECK": PRINT SPC( 7)"THE DECK HAS ";: INVERSE : PRINT C1;: NORMAL : PRINT " CARDS LEFT ";
410 POKE 49168,0
420 WAIT 49152,128
430 A = PEEK(49152) -128: POKE 49168,0
440 IF A >A4 AND A <A6 THEN HTAB 1: GOTO 320
450 IF A = A3 THEN HOME : GOTO 6000: REM QUIT ROUTINE
460 IF A = A1 AND CU < >1 THEN OC = CU:CU = CU -1: GOSUB 7500: GOSUB 7000: GOTO 400
470 IF A = A2 AND CU < >7 THEN OC = CU:CU = CU +1: GOSUB 7500: GOSUB 7000: GOTO 400
480 IF A = A1 AND CU = 1 THEN OC = CU:CU = CU +6: GOSUB 7500: GOSUB 7000: GOTO 400
490 IF A = A2 AND CU = 7 THEN OC = CU:CU = CU -6: GOSUB 7500: GOSUB 7000: GOTO 400
500 IF A < >A5 THEN HOME : PRINT : PRINT "<CTRL-G> YOU GOOFED - TRY AGAIN<CTRL-G>": FOR P = 1 TO 2000: NEXT : GOTO 400
510 IF V(CU) = 0 THEN HOME : PRINT "<CTRL-G>THERE ARE NO CARDS HERE!<CTRL-G>": FOR P = 1 TO 3000: NEXT : GOTO 400
520 J = 28
530 IF V(J +CU) < >0 THEN I = J +CU:II = I -7: GOTO 600
540 IF J >7 THEN J = J -7: GOTO 530
560 I = CU
570 IF (V(I) = V(0) +1) OR (V(I) = V(0) -1) THEN HCOLOR= 4: DRAW 18 AT X(I),Y(I):V(0) = V(I):V(I) = 0:S(0) = S(I):S(I) = 0:I = 0: GOSUB 5000: GOTO 9000
580 GOTO 8000
600 IF (V(I) = V(0) +1) OR (V(I) = V(0) -1) THEN HCOLOR= 4: DRAW 18 AT X(I),Y(I): HCOLOR= 7: DRAW S(II) +5 AT X(I),Y(I):V(0) = V(I):V(I) = 0:S(0) = S(I):S(I) = 0:I = 0: GOSUB 5000: GOTO 9000
610 GOTO 8000
4999 END
5000 POKE 783,100: HCOLOR= 7: DRAW 18 AT X(I),Y(I): HCOLOR= 4: DRAW V(I) AT X(I) +5,Y(I) +5: CALL L
5010 IF S(I) = 14 OR S(I) = 15 THEN HCOLOR= 4
5020 IF S(I) = 16 OR S(I) = 17 THEN HCOLOR= 5
5030 DRAW S(I) AT X(I) +12,Y(I) +25: RETURN
6000 VTAB 22: PRINT "GIVE UP ON THIS HAND? ";: GET A$: PRINT A$: IF A$ < >"Y" AND A$ < >"N" THEN 6000
6010 IF A$ = "N" THEN 400
6020 HOME
6025 VTAB 24: PRINT "DO YOU WANT TO TRY AGAIN? ";: POKE 49168,0
6028 GET A$: IF A$ < >"Y" AND A$ < >"N" THEN 6028
6030 PRINT A$: IF A$ = "Y" THEN HGR : TEXT : HOME : GOTO 50
6050 TEXT : HOME : PRINT CHR$(4)"RUNMENU"
7000 I = CU +35: HCOLOR= 7: DRAW 53 AT X(I) +12,Y(I): RETURN
7500 I = OC +35: HCOLOR= 4: DRAW 53 AT X(I) +12,Y(I): RETURN
8000 HOME : PRINT : PRINT "<CTRL-G>THE "C$(V(I))" DOESN'T GO ON THE "C$(V(0))"!<CTRL-G>"
8130 FOR P = 1 TO 3000: NEXT : GOTO 400
9000 K = 0: FOR I = 1 TO 7:K = K +V(I): NEXT : IF K < >0 THEN GOTO 400
9060 HOME : VTAB 21: PRINT "<CTRL-G>Y<CTRL-G>O<CTRL-G>U<CTRL-G> <CTRL-G>W<CTRL-G>I<CTRL-G>N<CTRL-G> <CTRL-G><CTRL-J>AND STILL HAD "C1" CARDS TO PLAY!": GOTO 6025
9500 TL = 0:SP = 0: FOR I = 1 TO 7: FOR J = 5 TO 1 STEP -1:JI = 7 *(J -1) +I: IF V(JI) < >0 THEN TL = TL +J:J = 1: IF V(JI) = V(0) +1 OR V(JI) = V(0) -1 THEN SP = 1:I = 7
9510 NEXT : NEXT
9520 IF SP = 1 THEN RETURN
9600 POP : HOME : VTAB 21: PRINT "YOU LEFT ";: FOR N = 1 TO TL: HTAB 10: PRINT N;: CALL 768: FOR W = 1 TO 500: NEXT : NEXT : PRINT " CARDS! <CTRL-J> YOU LOSE!": GOTO 6025
20000 TEXT : HOME
20010 PRINT "THE DECK IS SHUFFLED AND DEALT FACE UP IN 7 VERTICAL COLUMNS OF 5 CARDS EACH.": PRINT "THE NEXT CARD IS THEN DEALT,FACE UP, UNDER THESE CARDS TO START THE PILE."
20015 PRINT
20020 PRINT "THE OBJECT OF THE GAME IS TO TRANSFER ALL THE CARDS IN THE SEVEN COLUMNS TO THE OUTPUT PILE.": PRINT "ONLY THE CARDS AT THE BOTTOM OF EACH COLUMN IS PLAYABLE"
20030 PRINT "A CARD CAN BE PLAYED TO THE OUTPUT FILE IF IT IS ONE NUMBER HIGHER OR ONE NUMBERLOWER THAN THE FILE CARD.": INVERSE : PRINT "SUITS ARE IGNORED AND THE ACE EQUALS ONE": NORMAL
20040 PRINT "IF A CARD CANNOT BE PLAYED TO THE FILE, THEN A CARD IS DEALT FROM DECK TO THE FILE.": PRINT "IF THERE ARE NO CARDS LEFT IN THE DECK THEN YOU LOSE."
20050 VTAB 24: PRINT "PRESS ANY KEY TO START";: WAIT 49152,128: POKE 49168,0: PRINT : RETURN
30000 FOR I = 1 TO 13: READ C$(I): NEXT
30010 DATA ACE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN,JACK,QUEEN,KING
30020 FOR I = 768 TO 789: READ J: POKE I,J: NEXT : DATA 160,1,162,0,138,24,233,1,208,252,141,48,192,232,224,125,208,242,136,208,237,96
30100 FOR X1 = 0 TO 2: FOR X2 = 0 TO 1: FOR X3 = 0 TO 6:I = 1 +X3 +7 *X2 +14 *X1:X(I) = 12 +32 *X3:Y(I) = 10 +15 *(2 *X1 +X2) +30 *(X1 = 2) *(X2 = 1): NEXT : NEXT : NEXT :X(0) = 120:Y(0) = 123
30110 FOR J = 1 TO 52:DK(J) = J: NEXT
31000 RETURN
49000 WAIT 49152,128
50000 END
59999 REM ADAPTED FROM ** ONE FOUNDATION ** - BY PAUL M. ZELMAN -
60000 REM <CTRL-J><CTRL-J>COMPLETELY REWRITTEN 5/18/83 BOB RAGSDALE<CTRL-J><CTRL-J>